home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / bin / DXUtils / dmotest.chm / ver.js < prev    next >
Text File  |  2001-10-08  |  679b  |  25 lines

  1. // common sniffing code
  2. var g_isIE       = false;
  3. var g_isNav      = false;
  4. var g_iMaj       = 0;
  5. var g_sPlat      = "";
  6.  
  7. g_sUA = window.navigator.appVersion;
  8.  
  9. if (parseInt(g_sUA.indexOf("MSIE ")) >= 0) // Check if IE
  10. {
  11.     g_isIE = true;
  12.     g_iMaj = parseInt(g_sUA.substring(g_sUA.indexOf("MSIE ")+5,g_sUA.indexOf (".",g_sUA.indexOf("MSIE "))));
  13.     if (g_sUA.lastIndexOf("Win") >= 0)
  14.         g_sPlat = "Win";
  15. }
  16. else if(parseInt(navigator.appName.lastIndexOf("Netscape"))>=0)
  17. {
  18.     g_isNav = true;
  19.     g_iMaj = parseInt(g_sUA.substring(0, g_sUA.indexOf('.')));
  20.     var sRelPath = "";
  21. }
  22.  
  23. g_isMac = g_sUA.indexOf("Mac") != -1;
  24. g_isGB = (g_isIE && g_iMaj >= 4 && g_sPlat == "Win");
  25.